<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
       <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/inhospitalDisease.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0">病案上架</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table">
                <ul class="clearfix" style="margin-bottom:0;">
                	<li class="Label_1" >出院日期：&nbsp;</li>
                    <li class="Label_4" style="text-align:center;width:35%">
                    	<input class="input_box" style="width:42%;" type="text"  name='startTime' id='outHospitalStartDate' value='' onFocus="WdatePicker()" />
                    	<span>&nbsp;-&nbsp;</span><input class="input_box" type="text" style="width:42%;"  name='endTime' id='outHospitalEndDate' value='' onFocus="WdatePicker()" />
                    </li>
                   <%--  <li class="Label_1" >出院科室：&nbsp;</li>
                    <li class="Label_2" style="padding-left:3px;" >
                       <select name="officeId" id="officeId" style="width:90%;height:28px;border-color:#e3e5e4">
							<option value="">请选择科室</option>
							<c:forEach items="${hospitalOfficeList}" var="hospitalOffice">
								<option value="${hospitalOffice.id}">${hospitalOffice.name}</option>
							</c:forEach>
						</select>
                    </li> --%>
                    <li class="Label_5">
                        <div class="right" style="text-align:right">
                            <a onclick="searchQua()">查询</a>
                        </div>
                    </li>
                  
                </ul>
            </div> 
             <table class="Search_tableList" cellpadding="0" cellspacing="0">
                <tr style="height:20px">
             
                    <td class="tdLabel_4" rowspan="2">出院科室</td>
                    <td class="tdLabel_4" style="width:20%">病案出院数</td>
                    <td class="tdLabel_4" style="width:20%">病案上架数</td>
                    <td class="tdLabel_4" style="width:20%">病案上架率</td>
                </tr>
          
                <tbody id="tbody">
                <!--  <tr>
                    <td class="tdLabel_5">101011-呼吸内科病房</td>
                    <td class="tdLabel_5">196</td>
                    <td class="tdLabel_5">195</td>
                    <td class="tdLabel_5">195</td>
                </tr> -->
                </tbody>
            </table>
        </div>
    </div>
</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">

    function searchQua(){
    	var officeId=$("#officeId").val();
		var outHospitalStartDate=$("#outHospitalStartDate").val();
		var outHospitalEndDate=$("#outHospitalEndDate").val();
		
		if((outHospitalStartDate==null || outHospitalStartDate=="") && (outHospitalEndDate==null || outHospitalEndDate=='') && (officeId==null || officeId=='')){
			alert("请输入查询条件!");
			return;
		}
		$.ajax({
			type:"post",
			url:"${basePath}/retrieval/getShelvedRate",
			data:{outHospitalStartTime:outHospitalStartDate,outHospitalEndTime:outHospitalEndDate,officeId:officeId},
			success:function(data){
				 /* console.log(data)  */
				$("#tbody").html("");
				if(data.success){
					var html="";
					var dataList=data.data;
					if(dataList.length>0){
				    	for(var i=0;i<dataList.length;i++){
				    		var medRecordCount=dataList[i].medRecordCount?dataList[i].medRecordCount:"0";
							var shelvedCount=dataList[i].shelvedCount?dataList[i].shelvedCount:"0";
				    		var shelvedRate=dataList[i].shelvedRate?dataList[i].shelvedRate:"0";
							html+=" <tr>"+
					              "      <td class='tdLabel_5'>"+dataList[i].officeName+"</td>"+
					              "      <td class='tdLabel_5'>"+medRecordCount+"</td>"+
					              "      <td class='tdLabel_5'>"+shelvedCount+"</td>"+
					              "      <td class='tdLabel_5'>"+shelvedRate+"%</td>"+
					              "  </tr>";
						}
						
						$("#tbody").html(html);
				    }else{
				    	alert("查询的数据为空！")
				    }
				} 
	
			}
		})
	}
</script>

</body>
</html>